package com.financing.wap.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.wap.dao.IFpBiddingReceiptDao;
import com.financing.wap.dto.FpBiddingReceiptDTO;
import com.financing.wap.dto.FpBiddingRevenueDTO;
import com.financing.wap.util.SqlName;



@Repository("fpBiddingReceiptDaoImpl")
public class FpBiddingReceiptDaoImpl extends BaseDaoImpl<FpBiddingReceiptDTO, java.lang.Integer> implements IFpBiddingReceiptDao {

	@Override
	public Class<FpBiddingReceiptDTO> getEntityClass() {
		return FpBiddingReceiptDTO.class;
	}

	@Override
	public Integer addFpBiddingReceipt(FpBiddingReceiptDTO dto) {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.addFpBiddingReceipt,dto);
	}

	@Override
	public List<Map<String, Object>> queryFpBiddingReceipt(
			FpBiddingReceiptDTO dto) {
		return this.sqlMapClientTemplate.queryForList(SqlName.queryFpBiddingReceipt,dto);
	}

	@Override
	public Integer addFpBiddingRevenue(FpBiddingRevenueDTO dto) {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.addFpBiddingRevenue,dto);
	}

	@Override
	public Map<String, Object> queryBiddingReceiptUserInfo(
			FpBiddingReceiptDTO dto) {
		return (Map<String, Object>) this.sqlMapClientTemplate.queryForObject(SqlName.queryBiddingReceiptUserInfo,dto);
	}

	@Override
	public List<Map<String, Object>> queryFpCurrentAnune(FpBiddingReceiptDTO dto) {
		return this.sqlMapClientTemplate.queryForList(SqlName.queryFpCurrentAnune, dto);
	}

	@Override
	public int updateBiddingReceipt(FpBiddingReceiptDTO dto) {
		 this.sqlMapClientTemplate.update(SqlName.updateBiddingReceipt,dto);
		 return 0;
	}

	@Override
	public FpBiddingReceiptDTO queryFpBiddingReceiptInfo(FpBiddingReceiptDTO dto) {
		return (FpBiddingReceiptDTO) this.sqlMapClientTemplate.queryForObject(SqlName.queryFpBiddingReceiptInfo, dto);
	}

	@Override
	public Map<String, Object> queryFpCurrentAnuneById(Integer id) {
		return  (Map<String, Object>) this.sqlMapClientTemplate.queryForObject(SqlName.queryFpCurrentAnuneById, id);
	}
	
	
}
